/***********************************************************
 * Product Name: ExcelQuicker
 * Copyright (c)2005, Eunge
 * Author: Eunge
 * Web Site: www.eudev.net
 * Mail/MSN: eudev.net@yeah.net
 * ********************************************************/
using System;

namespace ExcelQuicker.Framework
{
	/// <summary>
	/// The base class of text and graph
	/// </summary>
	[Serializable]
	public abstract class EQRangeBase: EQObject
	{
		private EQEventWorksheetHandler mAfterOperationEvent;
		private EQEventWorksheetHandler mBeforeOperationEvent;


		/// <summary>
		/// Output object to excel document
		/// </summary>
		/// <param name="objWorksheet"></param>
		protected internal abstract void Output(Excel.Worksheet objWorksheet);
		
		/// <summary>
		/// Raised before operation
		/// </summary>
		public EQEventWorksheetHandler BeforeOperationEvent
		{
			get
			{
				return this.mBeforeOperationEvent;
			}
			set
			{
				this.mBeforeOperationEvent = value;
			}
		}

		/// <summary>
		/// Raised after operation
		/// </summary>
		public EQEventWorksheetHandler AfterOperationEvent
		{
			get
			{
				return this.mAfterOperationEvent;
			}
			set
			{
				this.mAfterOperationEvent = value;
			}
		}

		/// <summary>
		/// Execute DoAfterOperationEvent delegate
		/// </summary>
		/// <param name="objWorksheet"></param>
		protected void DoAfterOperationEvent(Excel.Worksheet objWorksheet)
		{
			if(this.AfterOperationEvent != null)
				this.AfterOperationEvent(objWorksheet);
		}

		/// <summary>
		/// Execute DoBeforeOperationEvent delegate
		/// </summary>
		/// <param name="objWorksheet"></param>
		protected void DoBeforeOperationEvent(Excel.Worksheet objWorksheet)
		{
			if(this.BeforeOperationEvent != null)
				this.BeforeOperationEvent(objWorksheet);
		}
	}
}
